package com.kova.api.exception;

import com.kova.api.common.ResultEnum;
import lombok.Getter;
import lombok.Setter;

@SuppressWarnings("serial")
public class CommonException extends RuntimeException{

    @Getter
    @Setter
    private int code;

    @Getter
    @Setter
    private String msg;

    public CommonException(ResultEnum rstEnum){
        super(rstEnum.getMsg());
        this.code = rstEnum.getCode();
        this.msg = rstEnum.getMsg();
    }

    public CommonException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
}
